<template>
  <view class="u-page">

    <u-cell-group :border="false">
      <u-cell icon="account" title="修改密码" :isLink="true" @click="handleToPwd"></u-cell>
      <!-- #ifdef APP-PLUS -->
      <u-cell icon="question-circle" title="检查更新" :isLink="true" @click="handleToUpgrade"></u-cell>
      <!-- #endif -->

      <u-cell icon="star" title="清理缓存" :isLink="true" @click="handleCleanTmp"></u-cell>

      <up-button style="margin-top: 3vh;" type="primary" text="退出登录" @click="handleLogout"></up-button>
    </u-cell-group>

  </view>
</template>

<script setup lang="ts">
import checkShowPage from '@/utils/checkShowPage';
import { useUserStore } from '@/store/modules/user';

const userStore = useUserStore();

const handleToPwd = async () => {
  tab.navigateTo('/pages/mine/pwd/index');
};
const handleToUpgrade = async () => {
  modal.showToast('模块建设中~');
};
const handleCleanTmp = async () => {
  modal.loading('缓存清除中...');
  setTimeout(() => {
    modal.closeLoading();
    modal.msgSuccess('缓存清除成功');
  }, 3000);
};
const handleLogout = async () => {
  modal.confirm('确定注销并退出系统吗？').then(() => {
    userStore.logout().then(() => {
      tab.reLaunch(checkShowPage.loginPage);
    });
  });
};

</script>

<style lang="scss" scoped>


</style>
